package cn.wizzer.app.crown.modules.models.caches;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * 冠军缓存模型
 */
@Data
public class CrownMatchChampion implements Serializable {

    /**
     * 联赛ID
     */
    private String leagueId;

    /**
     * 联赛赛段或条件
     */
    private String coeWord;

    /**
     * 队伍
     */
    private String team;

    /**
     * 赔率
     */
    private BigDecimal odds;

    /**
     * 时间
     */
    private Date time;

    /**
     * 队伍Id（防止队伍名称变化）
     */
    private String tId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CrownMatchChampion that = (CrownMatchChampion) o;
        return leagueId.equals(that.leagueId) &&
                coeWord.equals(that.coeWord) &&
                time.equals(that.time) &&
                tId.equals(that.tId)&&
                team.equals(that.team)&&
                (odds.compareTo(that.odds) == 0);

    }

    @Override
    public int hashCode() {
        return Objects.hash(leagueId, coeWord, team, odds, time, tId);
    }

}
